Agile git and the story branch pattern

— December 18, 2008 at 23:39 PST


I've been using git for source code management for over a year now and I'm totally hooked. I won't rave about all the usual reasons WhyGitIsBetterThanX since it's been done already. Instead, I'm going to share how I use git for easy agile development.

The basic idea is to never do anything in the master branch except use it to move changes between the remote repo and local branches. Keeping master clean takes very little effort and will save your bacon when you get into trouble. The example I'll use here is working on a story to render title text in a bold style on a page.

Continue reading...

22 commentsagile, git

Saying Goodbye to New York, Speaking at nyc.rb

— December 8, 2008 at 20:41 PST


As my extended silence here has probably indicated, New York has been keeping me busy. It's been a crazy, hectic, and wonderful couple of months. I learned a lot, met some great people, and ate way too much pizza. I've also achieved that particular New York state of mind where I'm no longer phased by anything. However, this is my last week in New York before I return home to my beautiful city of San Francisco. I'm going to miss a lot about New York, but not the winter weather. Seriously, 25 degrees is not a reasonable temperature, and whoever thought so should be fired.

I didn't manage to post a note about it here, but last month I delivered a keynote talk at Voices that Matter: Professional Ruby Conference (which I affectionately christened ObieConf). My talk was Ruby: Fragile or Agile? I guess by the time I got them my talk info they were too busy to update the site so there's no description on the site, but the talk was about Ruby's destiny, and how lessons learned from when C++ ate Smalltalk's lunch could be instructive in guiding Ruby's future. I'll be reprising the talk tomorrow night (perhaps tonight by the time you read this (or yesterday if you're a feed slacker)) at the nyc.rb meeting.

The Pivotal office here in NY is coming along nicely. We've hired a few locals and moved into a bigger space, so we're ready to rock. And our first NY office production launched recently - Cookstr.com. Oh by the way, I'm starting to do more blogging on the Pivotal Labs technical blog, Pivotal Blabs. My most recent post is about using ActiveRecord internals to easily generate subselects.

I've got a few topics queued up to blog about on here too, so I'm hoping I'll be able to catch up some shortly. Stay tuned.

Oh yeah, I got to try a lot of the pizza suggestions. I really liked Grimaldi's, Lombardi's, and Two Boots. But man, Caracas Arepa Bar beats pizza nearly any day.

3 commentsevents, new york

Hello, New York

— September 22, 2008 at 19:38 PDT


By way of the obligatory sorry-I-haven't-blogged-much-lately apologette, I should say that life has been busy this summer. The second biggest deal for me was, get this, moving to New York City. Yes, I know I just moved to a new place in San Francisco, and no, I haven't given up on my favorite city. It's a temporary move and I should be back in SF by the end of the year. What happened is that Pivotal Labs has opened an office in Manhattan, and I've come out to work on client projects and help get the office going. The takeaway on that is that Pivotal Labs is available for projects in New York, and we're also looking to hire top-notch Rails developers to work with us here.

The word I have to pick to describe New York is vital. That's true of the city in general, but from what I've heard it's also true of the Ruby development community. I am looking forward to getting to hang with folks here and see what I can learn from the other coast. There's a lot of Ruby developer events around here. I'm going to start with the nyc.rb hackfest tomorrow.

While I'm out here on the East Coast, I'm going to hit up some conferences. In November I'll be attending RubyConf 2008 in Orlando. Then later that month I'll be at the Voices That Matter: Professional Ruby Conference, giving a talk entitled "Ruby: Fragile or Agile?"

In the mean time, where's the best pizza in New York?

22 commentsconference, new york

Sorting things out

— August 17, 2008 at 10:49 PDT


I recently packed up everything I own and moved. I'd lived in my old place for about nine years and I have the packrat gene on both sides of the family tree, so I had a lot of crap to sort through to figure out what to move and what to trash, as well as which box what should go in. Now that I'm here in the new place, I've had to sort through the remaining stuff to figure out where it all goes. So you might appreciate that sorting has been on my mind a lot lately. (See? It's a topical tie-in. I don't do those often, so I hope it wasn't too awkward.)

I've also been working on an application that does a lot of sorting to prioritize tasks in a workflow. These items often need to be sorted based on multiple criteria, such as how long an application has been waiting for approval, how many times a customer has been called recently, etc. We also have to sort names that have anywhere from two to four components (Hispanic names can have both paternal and maternal names instead of just a surname).

Continue reading...

10 commentsruby, sorting

Extra geeky: the recursive lambda

— June 20, 2008 at 11:06 PDT


I'm not sure where I first heard that you could do a recursive lamdba in Ruby, but it's been simmering on the back burner of my brain for a while. I've just never had a reason to use one, until now...

I wanted to process the Rails request params, which is a hash of strings and hashes of strings and hashes of strings and hashes... you get the idea. The need was to strip all the accent marks from user input throughout the application. Here's what I came up with:

class ApplicationController < ActionController::Base
  before_filter :strip_accents

  protected
  def strip_accents
    thunk = lambda do |key,value|
      case value
        when String then value.remove_accents!
        when Hash   then value.each(&thunk)
      end
    end
    params.each(&thunk)
  end
end

That's all completely clear, right? The filter enumerates the top-level hash using the &/to_proc operator to coerce the lambda to a block for the #each method. #each passes the key and value to the lambda, which either removes the accents from a string, or recursively enumerates the contents of a nested hash.

I think it's totally cool that you can do this in Ruby. Everyone thinks that Ruby is just an object-oriented language, but I like to think of it as the love-child of Smalltalk and LISP (with Miss Perl as the nanny).

15 commentsarcana, rails, ruby

Archives